package com.course.service;

import com.course.dao.CourseVieDataDao;
import com.course.model.CourseVieData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseVieDataService {
    @Autowired
    CourseVieDataDao courseVieDataDao;

    public List<CourseVieData> findVieCourseData(long nowTime) {
        return courseVieDataDao.findVieCourseData(nowTime);
    }

    public Integer getApplyNumByCourseId(Integer courseId) {
        return courseVieDataDao.getApplyNumByCourseId(courseId);
    }

    public void reduceApplyNum(Integer courseId, Integer apply_num) {
        courseVieDataDao.reduceApplyNum(courseId, apply_num);
    }
}
